home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / update / nsIUpdateService.h
C/C++ Source or Header  |  2006-05-08  |  62KB  |  1,603 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIUpdateService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIUpdateService_h__
  6. #define __gen_nsIUpdateService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIDOMDocument; /* forward declaration */
  18.  
  19. class nsIDOMElement; /* forward declaration */
  20.  
  21. class nsIDOMWindow; /* forward declaration */
  22.  
  23. class nsIRequest; /* forward declaration */
  24.  
  25. class nsIRequestObserver; /* forward declaration */
  26.  
  27. class nsISimpleEnumerator; /* forward declaration */
  28.  
  29. class nsITimerCallback; /* forward declaration */
  30.  
  31. class nsIXMLHttpRequest; /* forward declaration */
  32.  
  33.  
  34. /* starting interface:    nsIUpdatePatch */
  35. #define NS_IUPDATEPATCH_IID_STR "56863a67-bd69-42de-9f40-583e625b457d"
  36.  
  37. #define NS_IUPDATEPATCH_IID \
  38.   {0x56863a67, 0xbd69, 0x42de, \
  39.     { 0x9f, 0x40, 0x58, 0x3e, 0x62, 0x5b, 0x45, 0x7d }}
  40.  
  41. /**
  42.  * An interface that describes an object representing a patch file that can
  43.  * be downloaded and applied to a version of this application so that it
  44.  * can be updated.
  45.  */
  46. class NS_NO_VTABLE nsIUpdatePatch : public nsISupports {
  47.  public: 
  48.  
  49.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPDATEPATCH_IID)
  50.  
  51.   /**
  52.    * The type of this patch:
  53.    * "partial"      A binary difference between two application versions
  54.    * "complete"     A complete patch containing all of the replacement files
  55.    *                to update to the new version
  56.    */
  57.   /* attribute AString type; */
  58.   NS_IMETHOD GetType(nsAString & aType) = 0;
  59.   NS_IMETHOD SetType(const nsAString & aType) = 0;
  60.  
  61.   /**
  62.    * The URL this patch was being downloaded from
  63.    */
  64.   /* attribute AString URL; */
  65.   NS_IMETHOD GetURL(nsAString & aURL) = 0;
  66.   NS_IMETHOD SetURL(const nsAString & aURL) = 0;
  67.  
  68.   /**
  69.    * The hash function to use when determining this file's integrity
  70.    */
  71.   /* attribute AString hashFunction; */
  72.   NS_IMETHOD GetHashFunction(nsAString & aHashFunction) = 0;
  73.   NS_IMETHOD SetHashFunction(const nsAString & aHashFunction) = 0;
  74.  
  75.   /**
  76.    * The value of the hash function named above that should be computed if
  77.    * this file is not corrupt.
  78.    */
  79.   /* attribute AString hashValue; */
  80.   NS_IMETHOD GetHashValue(nsAString & aHashValue) = 0;
  81.   NS_IMETHOD SetHashValue(const nsAString & aHashValue) = 0;
  82.  
  83.   /**
  84.    * The size of this file, in bytes. 
  85.    */
  86.   /* attribute unsigned long size; */
  87.   NS_IMETHOD GetSize(PRUint32 *aSize) = 0;
  88.   NS_IMETHOD SetSize(PRUint32 aSize) = 0;
  89.  
  90.   /**
  91.    * The state of this patch
  92.    */
  93.   /* attribute AString state; */
  94.   NS_IMETHOD GetState(nsAString & aState) = 0;
  95.   NS_IMETHOD SetState(const nsAString & aState) = 0;
  96.  
  97.   /**
  98.    * true if this patch is currently selected as the patch to be downloaded and
  99.    * installed for this update transaction, false if another patch from this
  100.    * update has been selected. 
  101.    */
  102.   /* attribute boolean selected; */
  103.   NS_IMETHOD GetSelected(PRBool *aSelected) = 0;
  104.   NS_IMETHOD SetSelected(PRBool aSelected) = 0;
  105.  
  106.   /**
  107.    * Serializes this patch object into a DOM Element
  108.    * @param   updates
  109.    *          The document to serialize into
  110.    * @returns The DOM Element created by the serialization process
  111.    */
  112.   /* nsIDOMElement serialize (in nsIDOMDocument updates); */
  113.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval) = 0;
  114.  
  115. };
  116.  
  117. /* Use this macro when declaring classes that implement this interface. */
  118. #define NS_DECL_NSIUPDATEPATCH \
  119.   NS_IMETHOD GetType(nsAString & aType); \
  120.   NS_IMETHOD SetType(const nsAString & aType); \
  121.   NS_IMETHOD GetURL(nsAString & aURL); \
  122.   NS_IMETHOD SetURL(const nsAString & aURL); \
  123.   NS_IMETHOD GetHashFunction(nsAString & aHashFunction); \
  124.   NS_IMETHOD SetHashFunction(const nsAString & aHashFunction); \
  125.   NS_IMETHOD GetHashValue(nsAString & aHashValue); \
  126.   NS_IMETHOD SetHashValue(const nsAString & aHashValue); \
  127.   NS_IMETHOD GetSize(PRUint32 *aSize); \
  128.   NS_IMETHOD SetSize(PRUint32 aSize); \
  129.   NS_IMETHOD GetState(nsAString & aState); \
  130.   NS_IMETHOD SetState(const nsAString & aState); \
  131.   NS_IMETHOD GetSelected(PRBool *aSelected); \
  132.   NS_IMETHOD SetSelected(PRBool aSelected); \
  133.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval); 
  134.  
  135. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  136. #define NS_FORWARD_NSIUPDATEPATCH(_to) \
  137.   NS_IMETHOD GetType(nsAString & aType) { return _to GetType(aType); } \
  138.   NS_IMETHOD SetType(const nsAString & aType) { return _to SetType(aType); } \
  139.   NS_IMETHOD GetURL(nsAString & aURL) { return _to GetURL(aURL); } \
  140.   NS_IMETHOD SetURL(const nsAString & aURL) { return _to SetURL(aURL); } \
  141.   NS_IMETHOD GetHashFunction(nsAString & aHashFunction) { return _to GetHashFunction(aHashFunction); } \
  142.   NS_IMETHOD SetHashFunction(const nsAString & aHashFunction) { return _to SetHashFunction(aHashFunction); } \
  143.   NS_IMETHOD GetHashValue(nsAString & aHashValue) { return _to GetHashValue(aHashValue); } \
  144.   NS_IMETHOD SetHashValue(const nsAString & aHashValue) { return _to SetHashValue(aHashValue); } \
  145.   NS_IMETHOD GetSize(PRUint32 *aSize) { return _to GetSize(aSize); } \
  146.   NS_IMETHOD SetSize(PRUint32 aSize) { return _to SetSize(aSize); } \
  147.   NS_IMETHOD GetState(nsAString & aState) { return _to GetState(aState); } \
  148.   NS_IMETHOD SetState(const nsAString & aState) { return _to SetState(aState); } \
  149.   NS_IMETHOD GetSelected(PRBool *aSelected) { return _to GetSelected(aSelected); } \
  150.   NS_IMETHOD SetSelected(PRBool aSelected) { return _to SetSelected(aSelected); } \
  151.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval) { return _to Serialize(updates, _retval); } 
  152.  
  153. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  154. #define NS_FORWARD_SAFE_NSIUPDATEPATCH(_to) \
  155.   NS_IMETHOD GetType(nsAString & aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  156.   NS_IMETHOD SetType(const nsAString & aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetType(aType); } \
  157.   NS_IMETHOD GetURL(nsAString & aURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetURL(aURL); } \
  158.   NS_IMETHOD SetURL(const nsAString & aURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetURL(aURL); } \
  159.   NS_IMETHOD GetHashFunction(nsAString & aHashFunction) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHashFunction(aHashFunction); } \
  160.   NS_IMETHOD SetHashFunction(const nsAString & aHashFunction) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHashFunction(aHashFunction); } \
  161.   NS_IMETHOD GetHashValue(nsAString & aHashValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHashValue(aHashValue); } \
  162.   NS_IMETHOD SetHashValue(const nsAString & aHashValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHashValue(aHashValue); } \
  163.   NS_IMETHOD GetSize(PRUint32 *aSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSize(aSize); } \
  164.   NS_IMETHOD SetSize(PRUint32 aSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSize(aSize); } \
  165.   NS_IMETHOD GetState(nsAString & aState) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetState(aState); } \
  166.   NS_IMETHOD SetState(const nsAString & aState) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetState(aState); } \
  167.   NS_IMETHOD GetSelected(PRBool *aSelected) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelected(aSelected); } \
  168.   NS_IMETHOD SetSelected(PRBool aSelected) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSelected(aSelected); } \
  169.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Serialize(updates, _retval); } 
  170.  
  171. #if 0
  172. /* Use the code below as a template for the implementation class for this interface. */
  173.  
  174. /* Header file */
  175. class nsUpdatePatch : public nsIUpdatePatch
  176. {
  177. public:
  178.   NS_DECL_ISUPPORTS
  179.   NS_DECL_NSIUPDATEPATCH
  180.  
  181.   nsUpdatePatch();
  182.  
  183. private:
  184.   ~nsUpdatePatch();
  185.  
  186. protected:
  187.   /* additional members */
  188. };
  189.  
  190. /* Implementation file */
  191. NS_IMPL_ISUPPORTS1(nsUpdatePatch, nsIUpdatePatch)
  192.  
  193. nsUpdatePatch::nsUpdatePatch()
  194. {
  195.   /* member initializers and constructor code */
  196. }
  197.  
  198. nsUpdatePatch::~nsUpdatePatch()
  199. {
  200.   /* destructor code */
  201. }
  202.  
  203. /* attribute AString type; */
  204. NS_IMETHODIMP nsUpdatePatch::GetType(nsAString & aType)
  205. {
  206.     return NS_ERROR_NOT_IMPLEMENTED;
  207. }
  208. NS_IMETHODIMP nsUpdatePatch::SetType(const nsAString & aType)
  209. {
  210.     return NS_ERROR_NOT_IMPLEMENTED;
  211. }
  212.  
  213. /* attribute AString URL; */
  214. NS_IMETHODIMP nsUpdatePatch::GetURL(nsAString & aURL)
  215. {
  216.     return NS_ERROR_NOT_IMPLEMENTED;
  217. }
  218. NS_IMETHODIMP nsUpdatePatch::SetURL(const nsAString & aURL)
  219. {
  220.     return NS_ERROR_NOT_IMPLEMENTED;
  221. }
  222.  
  223. /* attribute AString hashFunction; */
  224. NS_IMETHODIMP nsUpdatePatch::GetHashFunction(nsAString & aHashFunction)
  225. {
  226.     return NS_ERROR_NOT_IMPLEMENTED;
  227. }
  228. NS_IMETHODIMP nsUpdatePatch::SetHashFunction(const nsAString & aHashFunction)
  229. {
  230.     return NS_ERROR_NOT_IMPLEMENTED;
  231. }
  232.  
  233. /* attribute AString hashValue; */
  234. NS_IMETHODIMP nsUpdatePatch::GetHashValue(nsAString & aHashValue)
  235. {
  236.     return NS_ERROR_NOT_IMPLEMENTED;
  237. }
  238. NS_IMETHODIMP nsUpdatePatch::SetHashValue(const nsAString & aHashValue)
  239. {
  240.     return NS_ERROR_NOT_IMPLEMENTED;
  241. }
  242.  
  243. /* attribute unsigned long size; */
  244. NS_IMETHODIMP nsUpdatePatch::GetSize(PRUint32 *aSize)
  245. {
  246.     return NS_ERROR_NOT_IMPLEMENTED;
  247. }
  248. NS_IMETHODIMP nsUpdatePatch::SetSize(PRUint32 aSize)
  249. {
  250.     return NS_ERROR_NOT_IMPLEMENTED;
  251. }
  252.  
  253. /* attribute AString state; */
  254. NS_IMETHODIMP nsUpdatePatch::GetState(nsAString & aState)
  255. {
  256.     return NS_ERROR_NOT_IMPLEMENTED;
  257. }
  258. NS_IMETHODIMP nsUpdatePatch::SetState(const nsAString & aState)
  259. {
  260.     return NS_ERROR_NOT_IMPLEMENTED;
  261. }
  262.  
  263. /* attribute boolean selected; */
  264. NS_IMETHODIMP nsUpdatePatch::GetSelected(PRBool *aSelected)
  265. {
  266.     return NS_ERROR_NOT_IMPLEMENTED;
  267. }
  268. NS_IMETHODIMP nsUpdatePatch::SetSelected(PRBool aSelected)
  269. {
  270.     return NS_ERROR_NOT_IMPLEMENTED;
  271. }
  272.  
  273. /* nsIDOMElement serialize (in nsIDOMDocument updates); */
  274. NS_IMETHODIMP nsUpdatePatch::Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval)
  275. {
  276.     return NS_ERROR_NOT_IMPLEMENTED;
  277. }
  278.  
  279. /* End of implementation class template. */
  280. #endif
  281.  
  282.  
  283. /* starting interface:    nsIUpdate */
  284. #define NS_IUPDATE_IID_STR "b0fb539e-f4ab-4ea1-bd75-e6d2813e5fc1"
  285.  
  286. #define NS_IUPDATE_IID \
  287.   {0xb0fb539e, 0xf4ab, 0x4ea1, \
  288.     { 0xbd, 0x75, 0xe6, 0xd2, 0x81, 0x3e, 0x5f, 0xc1 }}
  289.  
  290. /**
  291.  * An interface that describes an object representing an available update to
  292.  * the current application - this update may have several available patches
  293.  * from which one must be selected to download and install, for example we
  294.  * might select a binary difference patch first and attempt to apply that, 
  295.  * then if the application process fails fall back to downloading a complete
  296.  * file-replace patch. This object also contains information about the update
  297.  * that the front end and other application services can use to learn more 
  298.  * about what is going on.
  299.  */
  300. class NS_NO_VTABLE nsIUpdate : public nsISupports {
  301.  public: 
  302.  
  303.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPDATE_IID)
  304.  
  305.   /**
  306.    * The type of update:
  307.    *   "major"  A major new version of the Application
  308.    *   "minor"  A minor update to the Application (e.g. security update)
  309.    */
  310.   /* attribute AString type; */
  311.   NS_IMETHOD GetType(nsAString & aType) = 0;
  312.   NS_IMETHOD SetType(const nsAString & aType) = 0;
  313.  
  314.   /**
  315.    * The name of the update, or "<Application Name> <Update Version>"
  316.    */
  317.   /* attribute AString name; */
  318.   NS_IMETHOD GetName(nsAString & aName) = 0;
  319.   NS_IMETHOD SetName(const nsAString & aName) = 0;
  320.  
  321.   /**
  322.    * The Application version of this update. 
  323.    */
  324.   /* attribute AString version; */
  325.   NS_IMETHOD GetVersion(nsAString & aVersion) = 0;
  326.   NS_IMETHOD SetVersion(const nsAString & aVersion) = 0;
  327.  
  328.   /**
  329.    * The Addon version of this update. Used by the Extension System to track 
  330.    * compatibility of installed addons with this update. 
  331.    */
  332.   /* attribute AString extensionVersion; */
  333.   NS_IMETHOD GetExtensionVersion(nsAString & aExtensionVersion) = 0;
  334.   NS_IMETHOD SetExtensionVersion(const nsAString & aExtensionVersion) = 0;
  335.  
  336.   /**
  337.    * The Build ID of this update. Used to determine a particular build, down
  338.    * to the hour, minute and second of its creation. This allows the system
  339.    * to differentiate between several nightly builds with the same |version|
  340.    * for example. 
  341.    */
  342.   /* attribute AString buildID; */
  343.   NS_IMETHOD GetBuildID(nsAString & aBuildID) = 0;
  344.   NS_IMETHOD SetBuildID(const nsAString & aBuildID) = 0;
  345.  
  346.   /**
  347.    * The URL to a page which offers details about the content of this 
  348.    * update. Ideally, this page is not the release notes but some other page
  349.    * that summarizes the differences between this update and the previous,
  350.    * which also links to the release notes.
  351.    */
  352.   /* attribute AString detailsURL; */
  353.   NS_IMETHOD GetDetailsURL(nsAString & aDetailsURL) = 0;
  354.   NS_IMETHOD SetDetailsURL(const nsAString & aDetailsURL) = 0;
  355.  
  356.   /**
  357.    * The URL to a HTML fragment that contains a license for this update. If
  358.    * this is specified, the user is shown the license file after they choose
  359.    * to install the update and they must agree to it before the download 
  360.    * commences.
  361.    */
  362.   /* attribute AString licenseURL; */
  363.   NS_IMETHOD GetLicenseURL(nsAString & aLicenseURL) = 0;
  364.   NS_IMETHOD SetLicenseURL(const nsAString & aLicenseURL) = 0;
  365.  
  366.   /**
  367.    * The URL to the Update Service that supplied this update.
  368.    */
  369.   /* attribute AString serviceURL; */
  370.   NS_IMETHOD GetServiceURL(nsAString & aServiceURL) = 0;
  371.   NS_IMETHOD SetServiceURL(const nsAString & aServiceURL) = 0;
  372.  
  373.   /**
  374.    * Whether or not the update being downloaded is a complete replacement of
  375.    * the user's existing installation or a patch representing the difference
  376.    * between the new version and the previous version.
  377.    */
  378.   /* attribute boolean isCompleteUpdate; */
  379.   NS_IMETHOD GetIsCompleteUpdate(PRBool *aIsCompleteUpdate) = 0;
  380.   NS_IMETHOD SetIsCompleteUpdate(PRBool aIsCompleteUpdate) = 0;
  381.  
  382.   /**
  383.    * Whether or not the update is a security update or not. If this is true, 
  384.    * then we present more serious sounding user interface messages to the 
  385.    * user. 
  386.    */
  387.   /* attribute boolean isSecurityUpdate; */
  388.   NS_IMETHOD GetIsSecurityUpdate(PRBool *aIsSecurityUpdate) = 0;
  389.   NS_IMETHOD SetIsSecurityUpdate(PRBool aIsSecurityUpdate) = 0;
  390.  
  391.   /**
  392.    * When the update was installed.
  393.    */
  394.   /* attribute long long installDate; */
  395.   NS_IMETHOD GetInstallDate(PRInt64 *aInstallDate) = 0;
  396.   NS_IMETHOD SetInstallDate(PRInt64 aInstallDate) = 0;
  397.  
  398.   /**
  399.    * A message associated with this update, if any.
  400.    */
  401.   /* attribute AString statusText; */
  402.   NS_IMETHOD GetStatusText(nsAString & aStatusText) = 0;
  403.   NS_IMETHOD SetStatusText(const nsAString & aStatusText) = 0;
  404.  
  405.   /**
  406.    * The currently selected patch for this update.
  407.    */
  408.   /* readonly attribute nsIUpdatePatch selectedPatch; */
  409.   NS_IMETHOD GetSelectedPatch(nsIUpdatePatch * *aSelectedPatch) = 0;
  410.  
  411.   /**
  412.    * The state of the selected patch:
  413.    *   "downloading"       The update is being downloaded.
  414.    *   "pending"           The update is ready to be applied.
  415.    *   "applying"          The update is being applied.
  416.    *   "succeeded"         The update was successfully applied.
  417.    *   "download-failed"   The update failed to be downloaded.
  418.    *   "failed"            The update failed to be applied.
  419.    */
  420.   /* attribute AString state; */
  421.   NS_IMETHOD GetState(nsAString & aState) = 0;
  422.   NS_IMETHOD SetState(const nsAString & aState) = 0;
  423.  
  424.   /**
  425.    * A numeric error code that conveys additional information about the state
  426.    * of a failed update.  If the update is not in the "failed" state, then this
  427.    * value is zero.
  428.    *
  429.    * TODO: Define typical error codes (for now, see updater/errors.h)
  430.    */
  431.   /* attribute long errorCode; */
  432.   NS_IMETHOD GetErrorCode(PRInt32 *aErrorCode) = 0;
  433.   NS_IMETHOD SetErrorCode(PRInt32 aErrorCode) = 0;
  434.  
  435.   /**
  436.    * The number of patches supplied by this update.
  437.    */
  438.   /* readonly attribute unsigned long patchCount; */
  439.   NS_IMETHOD GetPatchCount(PRUint32 *aPatchCount) = 0;
  440.  
  441.   /**
  442.    * Retrieves a patch. 
  443.    * @param   index
  444.    *          The index of the patch to retrieve.
  445.    * @returns The nsIUpdatePatch at the specified index.
  446.    */
  447.   /* nsIUpdatePatch getPatchAt (in unsigned long index); */
  448.   NS_IMETHOD GetPatchAt(PRUint32 index, nsIUpdatePatch **_retval) = 0;
  449.  
  450.   /**
  451.    * Serializes this update object into a DOM Element
  452.    * @param   updates
  453.    *          The document to serialize into
  454.    * @returns The DOM Element created by the serialization process
  455.    */
  456.   /* nsIDOMElement serialize (in nsIDOMDocument updates); */
  457.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval) = 0;
  458.  
  459. };
  460.  
  461. /* Use this macro when declaring classes that implement this interface. */
  462. #define NS_DECL_NSIUPDATE \
  463.   NS_IMETHOD GetType(nsAString & aType); \
  464.   NS_IMETHOD SetType(const nsAString & aType); \
  465.   NS_IMETHOD GetName(nsAString & aName); \
  466.   NS_IMETHOD SetName(const nsAString & aName); \
  467.   NS_IMETHOD GetVersion(nsAString & aVersion); \
  468.   NS_IMETHOD SetVersion(const nsAString & aVersion); \
  469.   NS_IMETHOD GetExtensionVersion(nsAString & aExtensionVersion); \
  470.   NS_IMETHOD SetExtensionVersion(const nsAString & aExtensionVersion); \
  471.   NS_IMETHOD GetBuildID(nsAString & aBuildID); \
  472.   NS_IMETHOD SetBuildID(const nsAString & aBuildID); \
  473.   NS_IMETHOD GetDetailsURL(nsAString & aDetailsURL); \
  474.   NS_IMETHOD SetDetailsURL(const nsAString & aDetailsURL); \
  475.   NS_IMETHOD GetLicenseURL(nsAString & aLicenseURL); \
  476.   NS_IMETHOD SetLicenseURL(const nsAString & aLicenseURL); \
  477.   NS_IMETHOD GetServiceURL(nsAString & aServiceURL); \
  478.   NS_IMETHOD SetServiceURL(const nsAString & aServiceURL); \
  479.   NS_IMETHOD GetIsCompleteUpdate(PRBool *aIsCompleteUpdate); \
  480.   NS_IMETHOD SetIsCompleteUpdate(PRBool aIsCompleteUpdate); \
  481.   NS_IMETHOD GetIsSecurityUpdate(PRBool *aIsSecurityUpdate); \
  482.   NS_IMETHOD SetIsSecurityUpdate(PRBool aIsSecurityUpdate); \
  483.   NS_IMETHOD GetInstallDate(PRInt64 *aInstallDate); \
  484.   NS_IMETHOD SetInstallDate(PRInt64 aInstallDate); \
  485.   NS_IMETHOD GetStatusText(nsAString & aStatusText); \
  486.   NS_IMETHOD SetStatusText(const nsAString & aStatusText); \
  487.   NS_IMETHOD GetSelectedPatch(nsIUpdatePatch * *aSelectedPatch); \
  488.   NS_IMETHOD GetState(nsAString & aState); \
  489.   NS_IMETHOD SetState(const nsAString & aState); \
  490.   NS_IMETHOD GetErrorCode(PRInt32 *aErrorCode); \
  491.   NS_IMETHOD SetErrorCode(PRInt32 aErrorCode); \
  492.   NS_IMETHOD GetPatchCount(PRUint32 *aPatchCount); \
  493.   NS_IMETHOD GetPatchAt(PRUint32 index, nsIUpdatePatch **_retval); \
  494.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval); 
  495.  
  496. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  497. #define NS_FORWARD_NSIUPDATE(_to) \
  498.   NS_IMETHOD GetType(nsAString & aType) { return _to GetType(aType); } \
  499.   NS_IMETHOD SetType(const nsAString & aType) { return _to SetType(aType); } \
  500.   NS_IMETHOD GetName(nsAString & aName) { return _to GetName(aName); } \
  501.   NS_IMETHOD SetName(const nsAString & aName) { return _to SetName(aName); } \
  502.   NS_IMETHOD GetVersion(nsAString & aVersion) { return _to GetVersion(aVersion); } \
  503.   NS_IMETHOD SetVersion(const nsAString & aVersion) { return _to SetVersion(aVersion); } \
  504.   NS_IMETHOD GetExtensionVersion(nsAString & aExtensionVersion) { return _to GetExtensionVersion(aExtensionVersion); } \
  505.   NS_IMETHOD SetExtensionVersion(const nsAString & aExtensionVersion) { return _to SetExtensionVersion(aExtensionVersion); } \
  506.   NS_IMETHOD GetBuildID(nsAString & aBuildID) { return _to GetBuildID(aBuildID); } \
  507.   NS_IMETHOD SetBuildID(const nsAString & aBuildID) { return _to SetBuildID(aBuildID); } \
  508.   NS_IMETHOD GetDetailsURL(nsAString & aDetailsURL) { return _to GetDetailsURL(aDetailsURL); } \
  509.   NS_IMETHOD SetDetailsURL(const nsAString & aDetailsURL) { return _to SetDetailsURL(aDetailsURL); } \
  510.   NS_IMETHOD GetLicenseURL(nsAString & aLicenseURL) { return _to GetLicenseURL(aLicenseURL); } \
  511.   NS_IMETHOD SetLicenseURL(const nsAString & aLicenseURL) { return _to SetLicenseURL(aLicenseURL); } \
  512.   NS_IMETHOD GetServiceURL(nsAString & aServiceURL) { return _to GetServiceURL(aServiceURL); } \
  513.   NS_IMETHOD SetServiceURL(const nsAString & aServiceURL) { return _to SetServiceURL(aServiceURL); } \
  514.   NS_IMETHOD GetIsCompleteUpdate(PRBool *aIsCompleteUpdate) { return _to GetIsCompleteUpdate(aIsCompleteUpdate); } \
  515.   NS_IMETHOD SetIsCompleteUpdate(PRBool aIsCompleteUpdate) { return _to SetIsCompleteUpdate(aIsCompleteUpdate); } \
  516.   NS_IMETHOD GetIsSecurityUpdate(PRBool *aIsSecurityUpdate) { return _to GetIsSecurityUpdate(aIsSecurityUpdate); } \
  517.   NS_IMETHOD SetIsSecurityUpdate(PRBool aIsSecurityUpdate) { return _to SetIsSecurityUpdate(aIsSecurityUpdate); } \
  518.   NS_IMETHOD GetInstallDate(PRInt64 *aInstallDate) { return _to GetInstallDate(aInstallDate); } \
  519.   NS_IMETHOD SetInstallDate(PRInt64 aInstallDate) { return _to SetInstallDate(aInstallDate); } \
  520.   NS_IMETHOD GetStatusText(nsAString & aStatusText) { return _to GetStatusText(aStatusText); } \
  521.   NS_IMETHOD SetStatusText(const nsAString & aStatusText) { return _to SetStatusText(aStatusText); } \
  522.   NS_IMETHOD GetSelectedPatch(nsIUpdatePatch * *aSelectedPatch) { return _to GetSelectedPatch(aSelectedPatch); } \
  523.   NS_IMETHOD GetState(nsAString & aState) { return _to GetState(aState); } \
  524.   NS_IMETHOD SetState(const nsAString & aState) { return _to SetState(aState); } \
  525.   NS_IMETHOD GetErrorCode(PRInt32 *aErrorCode) { return _to GetErrorCode(aErrorCode); } \
  526.   NS_IMETHOD SetErrorCode(PRInt32 aErrorCode) { return _to SetErrorCode(aErrorCode); } \
  527.   NS_IMETHOD GetPatchCount(PRUint32 *aPatchCount) { return _to GetPatchCount(aPatchCount); } \
  528.   NS_IMETHOD GetPatchAt(PRUint32 index, nsIUpdatePatch **_retval) { return _to GetPatchAt(index, _retval); } \
  529.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval) { return _to Serialize(updates, _retval); } 
  530.  
  531. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  532. #define NS_FORWARD_SAFE_NSIUPDATE(_to) \
  533.   NS_IMETHOD GetType(nsAString & aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  534.   NS_IMETHOD SetType(const nsAString & aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetType(aType); } \
  535.   NS_IMETHOD GetName(nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
  536.   NS_IMETHOD SetName(const nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetName(aName); } \
  537.   NS_IMETHOD GetVersion(nsAString & aVersion) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVersion(aVersion); } \
  538.   NS_IMETHOD SetVersion(const nsAString & aVersion) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetVersion(aVersion); } \
  539.   NS_IMETHOD GetExtensionVersion(nsAString & aExtensionVersion) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetExtensionVersion(aExtensionVersion); } \
  540.   NS_IMETHOD SetExtensionVersion(const nsAString & aExtensionVersion) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetExtensionVersion(aExtensionVersion); } \
  541.   NS_IMETHOD GetBuildID(nsAString & aBuildID) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBuildID(aBuildID); } \
  542.   NS_IMETHOD SetBuildID(const nsAString & aBuildID) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBuildID(aBuildID); } \
  543.   NS_IMETHOD GetDetailsURL(nsAString & aDetailsURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDetailsURL(aDetailsURL); } \
  544.   NS_IMETHOD SetDetailsURL(const nsAString & aDetailsURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDetailsURL(aDetailsURL); } \
  545.   NS_IMETHOD GetLicenseURL(nsAString & aLicenseURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLicenseURL(aLicenseURL); } \
  546.   NS_IMETHOD SetLicenseURL(const nsAString & aLicenseURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLicenseURL(aLicenseURL); } \
  547.   NS_IMETHOD GetServiceURL(nsAString & aServiceURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetServiceURL(aServiceURL); } \
  548.   NS_IMETHOD SetServiceURL(const nsAString & aServiceURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetServiceURL(aServiceURL); } \
  549.   NS_IMETHOD GetIsCompleteUpdate(PRBool *aIsCompleteUpdate) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsCompleteUpdate(aIsCompleteUpdate); } \
  550.   NS_IMETHOD SetIsCompleteUpdate(PRBool aIsCompleteUpdate) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetIsCompleteUpdate(aIsCompleteUpdate); } \
  551.   NS_IMETHOD GetIsSecurityUpdate(PRBool *aIsSecurityUpdate) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSecurityUpdate(aIsSecurityUpdate); } \
  552.   NS_IMETHOD SetIsSecurityUpdate(PRBool aIsSecurityUpdate) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetIsSecurityUpdate(aIsSecurityUpdate); } \
  553.   NS_IMETHOD GetInstallDate(PRInt64 *aInstallDate) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInstallDate(aInstallDate); } \
  554.   NS_IMETHOD SetInstallDate(PRInt64 aInstallDate) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetInstallDate(aInstallDate); } \
  555.   NS_IMETHOD GetStatusText(nsAString & aStatusText) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStatusText(aStatusText); } \
  556.   NS_IMETHOD SetStatusText(const nsAString & aStatusText) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetStatusText(aStatusText); } \
  557.   NS_IMETHOD GetSelectedPatch(nsIUpdatePatch * *aSelectedPatch) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectedPatch(aSelectedPatch); } \
  558.   NS_IMETHOD GetState(nsAString & aState) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetState(aState); } \
  559.   NS_IMETHOD SetState(const nsAString & aState) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetState(aState); } \
  560.   NS_IMETHOD GetErrorCode(PRInt32 *aErrorCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetErrorCode(aErrorCode); } \
  561.   NS_IMETHOD SetErrorCode(PRInt32 aErrorCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetErrorCode(aErrorCode); } \
  562.   NS_IMETHOD GetPatchCount(PRUint32 *aPatchCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPatchCount(aPatchCount); } \
  563.   NS_IMETHOD GetPatchAt(PRUint32 index, nsIUpdatePatch **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPatchAt(index, _retval); } \
  564.   NS_IMETHOD Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Serialize(updates, _retval); } 
  565.  
  566. #if 0
  567. /* Use the code below as a template for the implementation class for this interface. */
  568.  
  569. /* Header file */
  570. class nsUpdate : public nsIUpdate
  571. {
  572. public:
  573.   NS_DECL_ISUPPORTS
  574.   NS_DECL_NSIUPDATE
  575.  
  576.   nsUpdate();
  577.  
  578. private:
  579.   ~nsUpdate();
  580.  
  581. protected:
  582.   /* additional members */
  583. };
  584.  
  585. /* Implementation file */
  586. NS_IMPL_ISUPPORTS1(nsUpdate, nsIUpdate)
  587.  
  588. nsUpdate::nsUpdate()
  589. {
  590.   /* member initializers and constructor code */
  591. }
  592.  
  593. nsUpdate::~nsUpdate()
  594. {
  595.   /* destructor code */
  596. }
  597.  
  598. /* attribute AString type; */
  599. NS_IMETHODIMP nsUpdate::GetType(nsAString & aType)
  600. {
  601.     return NS_ERROR_NOT_IMPLEMENTED;
  602. }
  603. NS_IMETHODIMP nsUpdate::SetType(const nsAString & aType)
  604. {
  605.     return NS_ERROR_NOT_IMPLEMENTED;
  606. }
  607.  
  608. /* attribute AString name; */
  609. NS_IMETHODIMP nsUpdate::GetName(nsAString & aName)
  610. {
  611.     return NS_ERROR_NOT_IMPLEMENTED;
  612. }
  613. NS_IMETHODIMP nsUpdate::SetName(const nsAString & aName)
  614. {
  615.     return NS_ERROR_NOT_IMPLEMENTED;
  616. }
  617.  
  618. /* attribute AString version; */
  619. NS_IMETHODIMP nsUpdate::GetVersion(nsAString & aVersion)
  620. {
  621.     return NS_ERROR_NOT_IMPLEMENTED;
  622. }
  623. NS_IMETHODIMP nsUpdate::SetVersion(const nsAString & aVersion)
  624. {
  625.     return NS_ERROR_NOT_IMPLEMENTED;
  626. }
  627.  
  628. /* attribute AString extensionVersion; */
  629. NS_IMETHODIMP nsUpdate::GetExtensionVersion(nsAString & aExtensionVersion)
  630. {
  631.     return NS_ERROR_NOT_IMPLEMENTED;
  632. }
  633. NS_IMETHODIMP nsUpdate::SetExtensionVersion(const nsAString & aExtensionVersion)
  634. {
  635.     return NS_ERROR_NOT_IMPLEMENTED;
  636. }
  637.  
  638. /* attribute AString buildID; */
  639. NS_IMETHODIMP nsUpdate::GetBuildID(nsAString & aBuildID)
  640. {
  641.     return NS_ERROR_NOT_IMPLEMENTED;
  642. }
  643. NS_IMETHODIMP nsUpdate::SetBuildID(const nsAString & aBuildID)
  644. {
  645.     return NS_ERROR_NOT_IMPLEMENTED;
  646. }
  647.  
  648. /* attribute AString detailsURL; */
  649. NS_IMETHODIMP nsUpdate::GetDetailsURL(nsAString & aDetailsURL)
  650. {
  651.     return NS_ERROR_NOT_IMPLEMENTED;
  652. }
  653. NS_IMETHODIMP nsUpdate::SetDetailsURL(const nsAString & aDetailsURL)
  654. {
  655.     return NS_ERROR_NOT_IMPLEMENTED;
  656. }
  657.  
  658. /* attribute AString licenseURL; */
  659. NS_IMETHODIMP nsUpdate::GetLicenseURL(nsAString & aLicenseURL)
  660. {
  661.     return NS_ERROR_NOT_IMPLEMENTED;
  662. }
  663. NS_IMETHODIMP nsUpdate::SetLicenseURL(const nsAString & aLicenseURL)
  664. {
  665.     return NS_ERROR_NOT_IMPLEMENTED;
  666. }
  667.  
  668. /* attribute AString serviceURL; */
  669. NS_IMETHODIMP nsUpdate::GetServiceURL(nsAString & aServiceURL)
  670. {
  671.     return NS_ERROR_NOT_IMPLEMENTED;
  672. }
  673. NS_IMETHODIMP nsUpdate::SetServiceURL(const nsAString & aServiceURL)
  674. {
  675.     return NS_ERROR_NOT_IMPLEMENTED;
  676. }
  677.  
  678. /* attribute boolean isCompleteUpdate; */
  679. NS_IMETHODIMP nsUpdate::GetIsCompleteUpdate(PRBool *aIsCompleteUpdate)
  680. {
  681.     return NS_ERROR_NOT_IMPLEMENTED;
  682. }
  683. NS_IMETHODIMP nsUpdate::SetIsCompleteUpdate(PRBool aIsCompleteUpdate)
  684. {
  685.     return NS_ERROR_NOT_IMPLEMENTED;
  686. }
  687.  
  688. /* attribute boolean isSecurityUpdate; */
  689. NS_IMETHODIMP nsUpdate::GetIsSecurityUpdate(PRBool *aIsSecurityUpdate)
  690. {
  691.     return NS_ERROR_NOT_IMPLEMENTED;
  692. }
  693. NS_IMETHODIMP nsUpdate::SetIsSecurityUpdate(PRBool aIsSecurityUpdate)
  694. {
  695.     return NS_ERROR_NOT_IMPLEMENTED;
  696. }
  697.  
  698. /* attribute long long installDate; */
  699. NS_IMETHODIMP nsUpdate::GetInstallDate(PRInt64 *aInstallDate)
  700. {
  701.     return NS_ERROR_NOT_IMPLEMENTED;
  702. }
  703. NS_IMETHODIMP nsUpdate::SetInstallDate(PRInt64 aInstallDate)
  704. {
  705.     return NS_ERROR_NOT_IMPLEMENTED;
  706. }
  707.  
  708. /* attribute AString statusText; */
  709. NS_IMETHODIMP nsUpdate::GetStatusText(nsAString & aStatusText)
  710. {
  711.     return NS_ERROR_NOT_IMPLEMENTED;
  712. }
  713. NS_IMETHODIMP nsUpdate::SetStatusText(const nsAString & aStatusText)
  714. {
  715.     return NS_ERROR_NOT_IMPLEMENTED;
  716. }
  717.  
  718. /* readonly attribute nsIUpdatePatch selectedPatch; */
  719. NS_IMETHODIMP nsUpdate::GetSelectedPatch(nsIUpdatePatch * *aSelectedPatch)
  720. {
  721.     return NS_ERROR_NOT_IMPLEMENTED;
  722. }
  723.  
  724. /* attribute AString state; */
  725. NS_IMETHODIMP nsUpdate::GetState(nsAString & aState)
  726. {
  727.     return NS_ERROR_NOT_IMPLEMENTED;
  728. }
  729. NS_IMETHODIMP nsUpdate::SetState(const nsAString & aState)
  730. {
  731.     return NS_ERROR_NOT_IMPLEMENTED;
  732. }
  733.  
  734. /* attribute long errorCode; */
  735. NS_IMETHODIMP nsUpdate::GetErrorCode(PRInt32 *aErrorCode)
  736. {
  737.     return NS_ERROR_NOT_IMPLEMENTED;
  738. }
  739. NS_IMETHODIMP nsUpdate::SetErrorCode(PRInt32 aErrorCode)
  740. {
  741.     return NS_ERROR_NOT_IMPLEMENTED;
  742. }
  743.  
  744. /* readonly attribute unsigned long patchCount; */
  745. NS_IMETHODIMP nsUpdate::GetPatchCount(PRUint32 *aPatchCount)
  746. {
  747.     return NS_ERROR_NOT_IMPLEMENTED;
  748. }
  749.  
  750. /* nsIUpdatePatch getPatchAt (in unsigned long index); */
  751. NS_IMETHODIMP nsUpdate::GetPatchAt(PRUint32 index, nsIUpdatePatch **_retval)
  752. {
  753.     return NS_ERROR_NOT_IMPLEMENTED;
  754. }
  755.  
  756. /* nsIDOMElement serialize (in nsIDOMDocument updates); */
  757. NS_IMETHODIMP nsUpdate::Serialize(nsIDOMDocument *updates, nsIDOMElement **_retval)
  758. {
  759.     return NS_ERROR_NOT_IMPLEMENTED;
  760. }
  761.  
  762. /* End of implementation class template. */
  763. #endif
  764.  
  765.  
  766. /* starting interface:    nsIUpdateCheckListener */
  767. #define NS_IUPDATECHECKLISTENER_IID_STR "8cbceb6e-8e27-46f2-8808-444c6499f836"
  768.  
  769. #define NS_IUPDATECHECKLISTENER_IID \
  770.   {0x8cbceb6e, 0x8e27, 0x46f2, \
  771.     { 0x88, 0x08, 0x44, 0x4c, 0x64, 0x99, 0xf8, 0x36 }}
  772.  
  773. /**
  774.  * An interface describing an object that listens to the progress of an update
  775.  * check operation. This object is notified as the check continues, finishes
  776.  * and if it has an error. 
  777.  */
  778. class NS_NO_VTABLE nsIUpdateCheckListener : public nsISupports {
  779.  public: 
  780.  
  781.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPDATECHECKLISTENER_IID)
  782.  
  783.   /**
  784.    * Called every time there is a progress notification loading the Update
  785.    * Service file.
  786.    * @param   request
  787.    *          The nsIXMLHttpRequest handling the update check.
  788.    * @param   position
  789.    *          The current byte downloaded
  790.    * @param   totalSize
  791.    *          The total number of bytes that have to be downloaded
  792.    */
  793.   /* void onProgress (in nsIXMLHttpRequest request, in unsigned long position, in unsigned long totalSize); */
  794.   NS_IMETHOD OnProgress(nsIXMLHttpRequest *request, PRUint32 position, PRUint32 totalSize) = 0;
  795.  
  796.   /**
  797.    * The update check was completed. 
  798.    * @param   request
  799.    *          The nsIXMLHttpRequest handling the update check.
  800.    * @param   updates
  801.    *          An array of nsIUpdate objects listing available updates.
  802.    * @param   updateCount
  803.    *          The size of the |updates| array.
  804.    */
  805.   /* void onCheckComplete (in nsIXMLHttpRequest request, [array, size_is (updateCount)] in nsIUpdate updates, in unsigned long updateCount); */
  806.   NS_IMETHOD OnCheckComplete(nsIXMLHttpRequest *request, nsIUpdate **updates, PRUint32 updateCount) = 0;
  807.  
  808.   /**
  809.    * An error occurred while loading the remote update service file. 
  810.    * @param   request
  811.    *          The nsIXMLHttpRequest handling the update check.
  812.    * @param   update
  813.    *          A nsIUpdate object that contains details about the 
  814.    *          error in its |statusText| property.
  815.    */
  816.   /* void onError (in nsIXMLHttpRequest request, in nsIUpdate update); */
  817.   NS_IMETHOD OnError(nsIXMLHttpRequest *request, nsIUpdate *update) = 0;
  818.  
  819. };
  820.  
  821. /* Use this macro when declaring classes that implement this interface. */
  822. #define NS_DECL_NSIUPDATECHECKLISTENER \
  823.   NS_IMETHOD OnProgress(nsIXMLHttpRequest *request, PRUint32 position, PRUint32 totalSize); \
  824.   NS_IMETHOD OnCheckComplete(nsIXMLHttpRequest *request, nsIUpdate **updates, PRUint32 updateCount); \
  825.   NS_IMETHOD OnError(nsIXMLHttpRequest *request, nsIUpdate *update); 
  826.  
  827. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  828. #define NS_FORWARD_NSIUPDATECHECKLISTENER(_to) \
  829.   NS_IMETHOD OnProgress(nsIXMLHttpRequest *request, PRUint32 position, PRUint32 totalSize) { return _to OnProgress(request, position, totalSize); } \
  830.   NS_IMETHOD OnCheckComplete(nsIXMLHttpRequest *request, nsIUpdate **updates, PRUint32 updateCount) { return _to OnCheckComplete(request, updates, updateCount); } \
  831.   NS_IMETHOD OnError(nsIXMLHttpRequest *request, nsIUpdate *update) { return _to OnError(request, update); } 
  832.  
  833. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  834. #define NS_FORWARD_SAFE_NSIUPDATECHECKLISTENER(_to) \
  835.   NS_IMETHOD OnProgress(nsIXMLHttpRequest *request, PRUint32 position, PRUint32 totalSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnProgress(request, position, totalSize); } \
  836.   NS_IMETHOD OnCheckComplete(nsIXMLHttpRequest *request, nsIUpdate **updates, PRUint32 updateCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnCheckComplete(request, updates, updateCount); } \
  837.   NS_IMETHOD OnError(nsIXMLHttpRequest *request, nsIUpdate *update) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnError(request, update); } 
  838.  
  839. #if 0
  840. /* Use the code below as a template for the implementation class for this interface. */
  841.  
  842. /* Header file */
  843. class nsUpdateCheckListener : public nsIUpdateCheckListener
  844. {
  845. public:
  846.   NS_DECL_ISUPPORTS
  847.   NS_DECL_NSIUPDATECHECKLISTENER
  848.  
  849.   nsUpdateCheckListener();
  850.  
  851. private:
  852.   ~nsUpdateCheckListener();
  853.  
  854. protected:
  855.   /* additional members */
  856. };
  857.  
  858. /* Implementation file */
  859. NS_IMPL_ISUPPORTS1(nsUpdateCheckListener, nsIUpdateCheckListener)
  860.  
  861. nsUpdateCheckListener::nsUpdateCheckListener()
  862. {
  863.   /* member initializers and constructor code */
  864. }
  865.  
  866. nsUpdateCheckListener::~nsUpdateCheckListener()
  867. {
  868.   /* destructor code */
  869. }
  870.  
  871. /* void onProgress (in nsIXMLHttpRequest request, in unsigned long position, in unsigned long totalSize); */
  872. NS_IMETHODIMP nsUpdateCheckListener::OnProgress(nsIXMLHttpRequest *request, PRUint32 position, PRUint32 totalSize)
  873. {
  874.     return NS_ERROR_NOT_IMPLEMENTED;
  875. }
  876.  
  877. /* void onCheckComplete (in nsIXMLHttpRequest request, [array, size_is (updateCount)] in nsIUpdate updates, in unsigned long updateCount); */
  878. NS_IMETHODIMP nsUpdateCheckListener::OnCheckComplete(nsIXMLHttpRequest *request, nsIUpdate **updates, PRUint32 updateCount)
  879. {
  880.     return NS_ERROR_NOT_IMPLEMENTED;
  881. }
  882.  
  883. /* void onError (in nsIXMLHttpRequest request, in nsIUpdate update); */
  884. NS_IMETHODIMP nsUpdateCheckListener::OnError(nsIXMLHttpRequest *request, nsIUpdate *update)
  885. {
  886.     return NS_ERROR_NOT_IMPLEMENTED;
  887. }
  888.  
  889. /* End of implementation class template. */
  890. #endif
  891.  
  892.  
  893. /* starting interface:    nsIUpdateChecker */
  894. #define NS_IUPDATECHECKER_IID_STR "877ace25-8bc5-452a-8586-9c1cf2871994"
  895.  
  896. #define NS_IUPDATECHECKER_IID \
  897.   {0x877ace25, 0x8bc5, 0x452a, \
  898.     { 0x85, 0x86, 0x9c, 0x1c, 0xf2, 0x87, 0x19, 0x94 }}
  899.  
  900. /**
  901.  * An interface describing an object that knows how to check for updates.
  902.  */
  903. class NS_NO_VTABLE nsIUpdateChecker : public nsISupports {
  904.  public: 
  905.  
  906.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPDATECHECKER_IID)
  907.  
  908.   /**
  909.    * Checks for available updates, notifying a listener of the results.
  910.    * @param   listener
  911.    *          An object implementing nsIUpdateCheckListener which is notified
  912.    *          of the results of an update check.
  913.    * @param   force
  914.    *          Forces the checker to check for updates, regardless of the 
  915.    *          current value of the user's update settings. This is used by
  916.    *          any piece of UI that offers the user the imperative option to
  917.    *          check for updates now, regardless of their update settings.
  918.    *          force will not work if the system administrator has locked
  919.    *          the app.update.enabled preference.
  920.    */
  921.   /* void checkForUpdates (in nsIUpdateCheckListener listener, in boolean force); */
  922.   NS_IMETHOD CheckForUpdates(nsIUpdateCheckListener *listener, PRBool force) = 0;
  923.  
  924.   /**
  925.    * Constants for the |stopChecking| function that tell the Checker how long
  926.    * to stop checking:
  927.    * 
  928.    * CURRENT_CHECK:     Stops the current (active) check only
  929.    * CURRENT_SESSION:   Stops all checking for the current session
  930.    * ANY_CHECKS:        Stops all checking, any session from now on
  931.    *                    (disables update checking preferences)
  932.    */
  933.   enum { CURRENT_CHECK = 1U };
  934.  
  935.   enum { CURRENT_SESSION = 2U };
  936.  
  937.   enum { ANY_CHECKS = 3U };
  938.  
  939.   /**
  940.    * Ends any pending update check.
  941.    * @param   duration
  942.    *          A value representing the set of checks to stop doing.
  943.    */
  944.   /* void stopChecking (in unsigned short duration); */
  945.   NS_IMETHOD StopChecking(PRUint16 duration) = 0;
  946.  
  947. };
  948.  
  949. /* Use this macro when declaring classes that implement this interface. */
  950. #define NS_DECL_NSIUPDATECHECKER \
  951.   NS_IMETHOD CheckForUpdates(nsIUpdateCheckListener *listener, PRBool force); \
  952.   NS_IMETHOD StopChecking(PRUint16 duration); 
  953.  
  954. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  955. #define NS_FORWARD_NSIUPDATECHECKER(_to) \
  956.   NS_IMETHOD CheckForUpdates(nsIUpdateCheckListener *listener, PRBool force) { return _to CheckForUpdates(listener, force); } \
  957.   NS_IMETHOD StopChecking(PRUint16 duration) { return _to StopChecking(duration); } 
  958.  
  959. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  960. #define NS_FORWARD_SAFE_NSIUPDATECHECKER(_to) \
  961.   NS_IMETHOD CheckForUpdates(nsIUpdateCheckListener *listener, PRBool force) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckForUpdates(listener, force); } \
  962.   NS_IMETHOD StopChecking(PRUint16 duration) { return !_to ? NS_ERROR_NULL_POINTER : _to->StopChecking(duration); } 
  963.  
  964. #if 0
  965. /* Use the code below as a template for the implementation class for this interface. */
  966.  
  967. /* Header file */
  968. class nsUpdateChecker : public nsIUpdateChecker
  969. {
  970. public:
  971.   NS_DECL_ISUPPORTS
  972.   NS_DECL_NSIUPDATECHECKER
  973.  
  974.   nsUpdateChecker();
  975.  
  976. private:
  977.   ~nsUpdateChecker();
  978.  
  979. protected:
  980.   /* additional members */
  981. };
  982.  
  983. /* Implementation file */
  984. NS_IMPL_ISUPPORTS1(nsUpdateChecker, nsIUpdateChecker)
  985.  
  986. nsUpdateChecker::nsUpdateChecker()
  987. {
  988.   /* member initializers and constructor code */
  989. }
  990.  
  991. nsUpdateChecker::~nsUpdateChecker()
  992. {
  993.   /* destructor code */
  994. }
  995.  
  996. /* void checkForUpdates (in nsIUpdateCheckListener listener, in boolean force); */
  997. NS_IMETHODIMP nsUpdateChecker::CheckForUpdates(nsIUpdateCheckListener *listener, PRBool force)
  998. {
  999.     return NS_ERROR_NOT_IMPLEMENTED;
  1000. }
  1001.  
  1002. /* void stopChecking (in unsigned short duration); */
  1003. NS_IMETHODIMP nsUpdateChecker::StopChecking(PRUint16 duration)
  1004. {
  1005.     return NS_ERROR_NOT_IMPLEMENTED;
  1006. }
  1007.  
  1008. /* End of implementation class template. */
  1009. #endif
  1010.  
  1011.  
  1012. /* starting interface:    nsIApplicationUpdateService */
  1013. #define NS_IAPPLICATIONUPDATESERVICE_IID_STR "9849c4bf-5197-4d22-baa8-e3b44a1703d2"
  1014.  
  1015. #define NS_IAPPLICATIONUPDATESERVICE_IID \
  1016.   {0x9849c4bf, 0x5197, 0x4d22, \
  1017.     { 0xba, 0xa8, 0xe3, 0xb4, 0x4a, 0x17, 0x03, 0xd2 }}
  1018.  
  1019. /**
  1020.  * An interface describing a global application service that handles performing
  1021.  * background update checks and provides utilities for selecting and 
  1022.  * downloading update patches.
  1023.  */
  1024. class NS_NO_VTABLE nsIApplicationUpdateService : public nsISupports {
  1025.  public: 
  1026.  
  1027.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IAPPLICATIONUPDATESERVICE_IID)
  1028.  
  1029.   /**
  1030.    * The Update Checker used for background update checking.
  1031.    */
  1032.   /* readonly attribute nsIUpdateChecker backgroundChecker; */
  1033.   NS_IMETHOD GetBackgroundChecker(nsIUpdateChecker * *aBackgroundChecker) = 0;
  1034.  
  1035.   /**
  1036.    * Selects the best update to install from a list of available updates.
  1037.    * @param   updates
  1038.    *          An array of updates that are available
  1039.    * @param   updateCount
  1040.    *          The length of the |updates| array
  1041.    */
  1042.   /* nsIUpdate selectUpdate ([array, size_is (updateCount)] in nsIUpdate updates, in unsigned long updateCount); */
  1043.   NS_IMETHOD SelectUpdate(nsIUpdate **updates, PRUint32 updateCount, nsIUpdate **_retval) = 0;
  1044.  
  1045.   /**
  1046.    * Adds a listener that receives progress and state information about the 
  1047.    * update that is currently being downloaded, e.g. to update a user 
  1048.    * interface.
  1049.    * @param   listener
  1050.    *          An object implementing nsIRequestObserver and optionally
  1051.    *          nsIProgressEventSink that is to be notified of state and
  1052.    *          progress information as the update is downloaded.
  1053.    */
  1054.   /* void addDownloadListener (in nsIRequestObserver listener); */
  1055.   NS_IMETHOD AddDownloadListener(nsIRequestObserver *listener) = 0;
  1056.  
  1057.   /**
  1058.    * Removes a listener that is receiving progress and state information
  1059.    * about the update that is currently being downloaded. 
  1060.    * @param   listener
  1061.    *          The listener object to remove.
  1062.    */
  1063.   /* void removeDownloadListener (in nsIRequestObserver listener); */
  1064.   NS_IMETHOD RemoveDownloadListener(nsIRequestObserver *listener) = 0;
  1065.  
  1066.   /**
  1067.    * 
  1068.    */
  1069.   /* AString downloadUpdate (in nsIUpdate update, in boolean background); */
  1070.   NS_IMETHOD DownloadUpdate(nsIUpdate *update, PRBool background, nsAString & _retval) = 0;
  1071.  
  1072.   /**
  1073.    * Pauses the active update download process
  1074.    */
  1075.   /* void pauseDownload (); */
  1076.   NS_IMETHOD PauseDownload(void) = 0;
  1077.  
  1078.   /**
  1079.    * Whether or not there is an download happening at the moment.
  1080.    */
  1081.   /* readonly attribute boolean isDownloading; */
  1082.   NS_IMETHOD GetIsDownloading(PRBool *aIsDownloading) = 0;
  1083.  
  1084.   /**
  1085.    * Whether or not the Update Service can download and install updates.
  1086.    * This is a function of whether or not the current user has access 
  1087.    * privileges to the install directory.
  1088.    */
  1089.   /* readonly attribute boolean canUpdate; */
  1090.   NS_IMETHOD GetCanUpdate(PRBool *aCanUpdate) = 0;
  1091.  
  1092. };
  1093.  
  1094. /* Use this macro when declaring classes that implement this interface. */
  1095. #define NS_DECL_NSIAPPLICATIONUPDATESERVICE \
  1096.   NS_IMETHOD GetBackgroundChecker(nsIUpdateChecker * *aBackgroundChecker); \
  1097.   NS_IMETHOD SelectUpdate(nsIUpdate **updates, PRUint32 updateCount, nsIUpdate **_retval); \
  1098.   NS_IMETHOD AddDownloadListener(nsIRequestObserver *listener); \
  1099.   NS_IMETHOD RemoveDownloadListener(nsIRequestObserver *listener); \
  1100.   NS_IMETHOD DownloadUpdate(nsIUpdate *update, PRBool background, nsAString & _retval); \
  1101.   NS_IMETHOD PauseDownload(void); \
  1102.   NS_IMETHOD GetIsDownloading(PRBool *aIsDownloading); \
  1103.   NS_IMETHOD GetCanUpdate(PRBool *aCanUpdate); 
  1104.  
  1105. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  1106. #define NS_FORWARD_NSIAPPLICATIONUPDATESERVICE(_to) \
  1107.   NS_IMETHOD GetBackgroundChecker(nsIUpdateChecker * *aBackgroundChecker) { return _to GetBackgroundChecker(aBackgroundChecker); } \
  1108.   NS_IMETHOD SelectUpdate(nsIUpdate **updates, PRUint32 updateCount, nsIUpdate **_retval) { return _to SelectUpdate(updates, updateCount, _retval); } \
  1109.   NS_IMETHOD AddDownloadListener(nsIRequestObserver *listener) { return _to AddDownloadListener(listener); } \
  1110.   NS_IMETHOD RemoveDownloadListener(nsIRequestObserver *listener) { return _to RemoveDownloadListener(listener); } \
  1111.   NS_IMETHOD DownloadUpdate(nsIUpdate *update, PRBool background, nsAString & _retval) { return _to DownloadUpdate(update, background, _retval); } \
  1112.   NS_IMETHOD PauseDownload(void) { return _to PauseDownload(); } \
  1113.   NS_IMETHOD GetIsDownloading(PRBool *aIsDownloading) { return _to GetIsDownloading(aIsDownloading); } \
  1114.   NS_IMETHOD GetCanUpdate(PRBool *aCanUpdate) { return _to GetCanUpdate(aCanUpdate); } 
  1115.  
  1116. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  1117. #define NS_FORWARD_SAFE_NSIAPPLICATIONUPDATESERVICE(_to) \
  1118.   NS_IMETHOD GetBackgroundChecker(nsIUpdateChecker * *aBackgroundChecker) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBackgroundChecker(aBackgroundChecker); } \
  1119.   NS_IMETHOD SelectUpdate(nsIUpdate **updates, PRUint32 updateCount, nsIUpdate **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectUpdate(updates, updateCount, _retval); } \
  1120.   NS_IMETHOD AddDownloadListener(nsIRequestObserver *listener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDownloadListener(listener); } \
  1121.   NS_IMETHOD RemoveDownloadListener(nsIRequestObserver *listener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDownloadListener(listener); } \
  1122.   NS_IMETHOD DownloadUpdate(nsIUpdate *update, PRBool background, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->DownloadUpdate(update, background, _retval); } \
  1123.   NS_IMETHOD PauseDownload(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->PauseDownload(); } \
  1124.   NS_IMETHOD GetIsDownloading(PRBool *aIsDownloading) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDownloading(aIsDownloading); } \
  1125.   NS_IMETHOD GetCanUpdate(PRBool *aCanUpdate) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCanUpdate(aCanUpdate); } 
  1126.  
  1127. #if 0
  1128. /* Use the code below as a template for the implementation class for this interface. */
  1129.  
  1130. /* Header file */
  1131. class nsApplicationUpdateService : public nsIApplicationUpdateService
  1132. {
  1133. public:
  1134.   NS_DECL_ISUPPORTS
  1135.   NS_DECL_NSIAPPLICATIONUPDATESERVICE
  1136.  
  1137.   nsApplicationUpdateService();
  1138.  
  1139. private:
  1140.   ~nsApplicationUpdateService();
  1141.  
  1142. protected:
  1143.   /* additional members */
  1144. };
  1145.  
  1146. /* Implementation file */
  1147. NS_IMPL_ISUPPORTS1(nsApplicationUpdateService, nsIApplicationUpdateService)
  1148.  
  1149. nsApplicationUpdateService::nsApplicationUpdateService()
  1150. {
  1151.   /* member initializers and constructor code */
  1152. }
  1153.  
  1154. nsApplicationUpdateService::~nsApplicationUpdateService()
  1155. {
  1156.   /* destructor code */
  1157. }
  1158.  
  1159. /* readonly attribute nsIUpdateChecker backgroundChecker; */
  1160. NS_IMETHODIMP nsApplicationUpdateService::GetBackgroundChecker(nsIUpdateChecker * *aBackgroundChecker)
  1161. {
  1162.     return NS_ERROR_NOT_IMPLEMENTED;
  1163. }
  1164.  
  1165. /* nsIUpdate selectUpdate ([array, size_is (updateCount)] in nsIUpdate updates, in unsigned long updateCount); */
  1166. NS_IMETHODIMP nsApplicationUpdateService::SelectUpdate(nsIUpdate **updates, PRUint32 updateCount, nsIUpdate **_retval)
  1167. {
  1168.     return NS_ERROR_NOT_IMPLEMENTED;
  1169. }
  1170.  
  1171. /* void addDownloadListener (in nsIRequestObserver listener); */
  1172. NS_IMETHODIMP nsApplicationUpdateService::AddDownloadListener(nsIRequestObserver *listener)
  1173. {
  1174.     return NS_ERROR_NOT_IMPLEMENTED;
  1175. }
  1176.  
  1177. /* void removeDownloadListener (in nsIRequestObserver listener); */
  1178. NS_IMETHODIMP nsApplicationUpdateService::RemoveDownloadListener(nsIRequestObserver *listener)
  1179. {
  1180.     return NS_ERROR_NOT_IMPLEMENTED;
  1181. }
  1182.  
  1183. /* AString downloadUpdate (in nsIUpdate update, in boolean background); */
  1184. NS_IMETHODIMP nsApplicationUpdateService::DownloadUpdate(nsIUpdate *update, PRBool background, nsAString & _retval)
  1185. {
  1186.     return NS_ERROR_NOT_IMPLEMENTED;
  1187. }
  1188.  
  1189. /* void pauseDownload (); */
  1190. NS_IMETHODIMP nsApplicationUpdateService::PauseDownload()
  1191. {
  1192.     return NS_ERROR_NOT_IMPLEMENTED;
  1193. }
  1194.  
  1195. /* readonly attribute boolean isDownloading; */
  1196. NS_IMETHODIMP nsApplicationUpdateService::GetIsDownloading(PRBool *aIsDownloading)
  1197. {
  1198.     return NS_ERROR_NOT_IMPLEMENTED;
  1199. }
  1200.  
  1201. /* readonly attribute boolean canUpdate; */
  1202. NS_IMETHODIMP nsApplicationUpdateService::GetCanUpdate(PRBool *aCanUpdate)
  1203. {
  1204.     return NS_ERROR_NOT_IMPLEMENTED;
  1205. }
  1206.  
  1207. /* End of implementation class template. */
  1208. #endif
  1209.  
  1210.  
  1211. /* starting interface:    nsIUpdateManager */
  1212. #define NS_IUPDATEMANAGER_IID_STR "fede66a9-9f96-4507-a22a-775ee885577e"
  1213.  
  1214. #define NS_IUPDATEMANAGER_IID \
  1215.   {0xfede66a9, 0x9f96, 0x4507, \
  1216.     { 0xa2, 0x2a, 0x77, 0x5e, 0xe8, 0x85, 0x57, 0x7e }}
  1217.  
  1218. /**
  1219.  * An interface describing a global application service that maintains a list
  1220.  * of updates previously performed as well as the current active update. 
  1221.  */
  1222. class NS_NO_VTABLE nsIUpdateManager : public nsISupports {
  1223.  public: 
  1224.  
  1225.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPDATEMANAGER_IID)
  1226.  
  1227.   /**
  1228.    * Gets the update at the specified index
  1229.    * @param   index
  1230.    *          The index within the updates array
  1231.    * @returns The nsIUpdate object at the specified index
  1232.    */
  1233.   /* nsIUpdate getUpdateAt (in long index); */
  1234.   NS_IMETHOD GetUpdateAt(PRInt32 index, nsIUpdate **_retval) = 0;
  1235.  
  1236.   /**
  1237.    * Gets the total number of updates in the history list. 
  1238.    */
  1239.   /* readonly attribute long updateCount; */
  1240.   NS_IMETHOD GetUpdateCount(PRInt32 *aUpdateCount) = 0;
  1241.  
  1242.   /**
  1243.    * The active (current) update. The active update is not in the history list.
  1244.    */
  1245.   /* attribute nsIUpdate activeUpdate; */
  1246.   NS_IMETHOD GetActiveUpdate(nsIUpdate * *aActiveUpdate) = 0;
  1247.   NS_IMETHOD SetActiveUpdate(nsIUpdate * aActiveUpdate) = 0;
  1248.  
  1249.   /**
  1250.    * Saves all updates to disk. 
  1251.    */
  1252.   /* void saveUpdates (); */
  1253.   NS_IMETHOD SaveUpdates(void) = 0;
  1254.  
  1255. };
  1256.  
  1257. /* Use this macro when declaring classes that implement this interface. */
  1258. #define NS_DECL_NSIUPDATEMANAGER \
  1259.   NS_IMETHOD GetUpdateAt(PRInt32 index, nsIUpdate **_retval); \
  1260.   NS_IMETHOD GetUpdateCount(PRInt32 *aUpdateCount); \
  1261.   NS_IMETHOD GetActiveUpdate(nsIUpdate * *aActiveUpdate); \
  1262.   NS_IMETHOD SetActiveUpdate(nsIUpdate * aActiveUpdate); \
  1263.   NS_IMETHOD SaveUpdates(void); 
  1264.  
  1265. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  1266. #define NS_FORWARD_NSIUPDATEMANAGER(_to) \
  1267.   NS_IMETHOD GetUpdateAt(PRInt32 index, nsIUpdate **_retval) { return _to GetUpdateAt(index, _retval); } \
  1268.   NS_IMETHOD GetUpdateCount(PRInt32 *aUpdateCount) { return _to GetUpdateCount(aUpdateCount); } \
  1269.   NS_IMETHOD GetActiveUpdate(nsIUpdate * *aActiveUpdate) { return _to GetActiveUpdate(aActiveUpdate); } \
  1270.   NS_IMETHOD SetActiveUpdate(nsIUpdate * aActiveUpdate) { return _to SetActiveUpdate(aActiveUpdate); } \
  1271.   NS_IMETHOD SaveUpdates(void) { return _to SaveUpdates(); } 
  1272.  
  1273. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  1274. #define NS_FORWARD_SAFE_NSIUPDATEMANAGER(_to) \
  1275.   NS_IMETHOD GetUpdateAt(PRInt32 index, nsIUpdate **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUpdateAt(index, _retval); } \
  1276.   NS_IMETHOD GetUpdateCount(PRInt32 *aUpdateCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUpdateCount(aUpdateCount); } \
  1277.   NS_IMETHOD GetActiveUpdate(nsIUpdate * *aActiveUpdate) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetActiveUpdate(aActiveUpdate); } \
  1278.   NS_IMETHOD SetActiveUpdate(nsIUpdate * aActiveUpdate) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetActiveUpdate(aActiveUpdate); } \
  1279.   NS_IMETHOD SaveUpdates(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->SaveUpdates(); } 
  1280.  
  1281. #if 0
  1282. /* Use the code below as a template for the implementation class for this interface. */
  1283.  
  1284. /* Header file */
  1285. class nsUpdateManager : public nsIUpdateManager
  1286. {
  1287. public:
  1288.   NS_DECL_ISUPPORTS
  1289.   NS_DECL_NSIUPDATEMANAGER
  1290.  
  1291.   nsUpdateManager();
  1292.  
  1293. private:
  1294.   ~nsUpdateManager();
  1295.  
  1296. protected:
  1297.   /* additional members */
  1298. };
  1299.  
  1300. /* Implementation file */
  1301. NS_IMPL_ISUPPORTS1(nsUpdateManager, nsIUpdateManager)
  1302.  
  1303. nsUpdateManager::nsUpdateManager()
  1304. {
  1305.   /* member initializers and constructor code */
  1306. }
  1307.  
  1308. nsUpdateManager::~nsUpdateManager()
  1309. {
  1310.   /* destructor code */
  1311. }
  1312.  
  1313. /* nsIUpdate getUpdateAt (in long index); */
  1314. NS_IMETHODIMP nsUpdateManager::GetUpdateAt(PRInt32 index, nsIUpdate **_retval)
  1315. {
  1316.     return NS_ERROR_NOT_IMPLEMENTED;
  1317. }
  1318.  
  1319. /* readonly attribute long updateCount; */
  1320. NS_IMETHODIMP nsUpdateManager::GetUpdateCount(PRInt32 *aUpdateCount)
  1321. {
  1322.     return NS_ERROR_NOT_IMPLEMENTED;
  1323. }
  1324.  
  1325. /* attribute nsIUpdate activeUpdate; */
  1326. NS_IMETHODIMP nsUpdateManager::GetActiveUpdate(nsIUpdate * *aActiveUpdate)
  1327. {
  1328.     return NS_ERROR_NOT_IMPLEMENTED;
  1329. }
  1330. NS_IMETHODIMP nsUpdateManager::SetActiveUpdate(nsIUpdate * aActiveUpdate)
  1331. {
  1332.     return NS_ERROR_NOT_IMPLEMENTED;
  1333. }
  1334.  
  1335. /* void saveUpdates (); */
  1336. NS_IMETHODIMP nsUpdateManager::SaveUpdates()
  1337. {
  1338.     return NS_ERROR_NOT_IMPLEMENTED;
  1339. }
  1340.  
  1341. /* End of implementation class template. */
  1342. #endif
  1343.  
  1344.  
  1345. /* starting interface:    nsIUpdatePrompt */
  1346. #define NS_IUPDATEPROMPT_IID_STR "22b00276-ec23-4034-a764-395da539b4be"
  1347.  
  1348. #define NS_IUPDATEPROMPT_IID \
  1349.   {0x22b00276, 0xec23, 0x4034, \
  1350.     { 0xa7, 0x64, 0x39, 0x5d, 0xa5, 0x39, 0xb4, 0xbe }}
  1351.  
  1352. /**
  1353.  * An interface describing an object that can show various kinds of Update 
  1354.  * notification UI to the user. 
  1355.  */
  1356. class NS_NO_VTABLE nsIUpdatePrompt : public nsISupports {
  1357.  public: 
  1358.  
  1359.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPDATEPROMPT_IID)
  1360.  
  1361.   /**
  1362.    * Shows a user interface that checks for and then displays the available
  1363.    * updates.
  1364.    */
  1365.   /* void checkForUpdates (); */
  1366.   NS_IMETHOD CheckForUpdates(void) = 0;
  1367.  
  1368.   /**
  1369.    * Show a message advising that an update is available for download and
  1370.    * install.
  1371.    * @param   update
  1372.    *          The update to be downloaded and installed
  1373.    */
  1374.   /* void showUpdateAvailable (in nsIUpdate update); */
  1375.   NS_IMETHOD ShowUpdateAvailable(nsIUpdate *update) = 0;
  1376.  
  1377.   /**
  1378.    * Show a message advising that an update has now been downloaded and that
  1379.    * the user should restart their software should be restarted so that the
  1380.    * update can be installed.
  1381.    * @param   update
  1382.    *          The update that was downloaded
  1383.    */
  1384.   /* void showUpdateDownloaded (in nsIUpdate update); */
  1385.   NS_IMETHOD ShowUpdateDownloaded(nsIUpdate *update) = 0;
  1386.  
  1387.   /**
  1388.    * Shows a message detailing the update which was installed.
  1389.    * @param   update
  1390.    *          The nsIUpdate object which was just installed
  1391.    */
  1392.   /* void showUpdateInstalled (in nsIUpdate update); */
  1393.   NS_IMETHOD ShowUpdateInstalled(nsIUpdate *update) = 0;
  1394.  
  1395.   /**
  1396.    * Shows an error message UI telling the user about some kind of update
  1397.    * failure, e.g. failure to apply patch.
  1398.    * @param   update
  1399.    *          The nsIUpdate object which we could not install
  1400.    */
  1401.   /* void showUpdateError (in nsIUpdate update); */
  1402.   NS_IMETHOD ShowUpdateError(nsIUpdate *update) = 0;
  1403.  
  1404.   /**
  1405.    * Shows a list of all updates installed to date.
  1406.    * @param   parent
  1407.    *          A parent window to anchor this window to. Can be null.
  1408.    */
  1409.   /* void showUpdateHistory (in nsIDOMWindow parent); */
  1410.   NS_IMETHOD ShowUpdateHistory(nsIDOMWindow *parent) = 0;
  1411.  
  1412. };
  1413.  
  1414. /* Use this macro when declaring classes that implement this interface. */
  1415. #define NS_DECL_NSIUPDATEPROMPT \
  1416.   NS_IMETHOD CheckForUpdates(void); \
  1417.   NS_IMETHOD ShowUpdateAvailable(nsIUpdate *update); \
  1418.   NS_IMETHOD ShowUpdateDownloaded(nsIUpdate *update); \
  1419.   NS_IMETHOD ShowUpdateInstalled(nsIUpdate *update); \
  1420.   NS_IMETHOD ShowUpdateError(nsIUpdate *update); \
  1421.   NS_IMETHOD ShowUpdateHistory(nsIDOMWindow *parent); 
  1422.  
  1423. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  1424. #define NS_FORWARD_NSIUPDATEPROMPT(_to) \
  1425.   NS_IMETHOD CheckForUpdates(void) { return _to CheckForUpdates(); } \
  1426.   NS_IMETHOD ShowUpdateAvailable(nsIUpdate *update) { return _to ShowUpdateAvailable(update); } \
  1427.   NS_IMETHOD ShowUpdateDownloaded(nsIUpdate *update) { return _to ShowUpdateDownloaded(update); } \
  1428.   NS_IMETHOD ShowUpdateInstalled(nsIUpdate *update) { return _to ShowUpdateInstalled(update); } \
  1429.   NS_IMETHOD ShowUpdateError(nsIUpdate *update) { return _to ShowUpdateError(update); } \
  1430.   NS_IMETHOD ShowUpdateHistory(nsIDOMWindow *parent) { return _to ShowUpdateHistory(parent); } 
  1431.  
  1432. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  1433. #define NS_FORWARD_SAFE_NSIUPDATEPROMPT(_to) \
  1434.   NS_IMETHOD CheckForUpdates(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckForUpdates(); } \
  1435.   NS_IMETHOD ShowUpdateAvailable(nsIUpdate *update) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowUpdateAvailable(update); } \
  1436.   NS_IMETHOD ShowUpdateDownloaded(nsIUpdate *update) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowUpdateDownloaded(update); } \
  1437.   NS_IMETHOD ShowUpdateInstalled(nsIUpdate *update) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowUpdateInstalled(update); } \
  1438.   NS_IMETHOD ShowUpdateError(nsIUpdate *update) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowUpdateError(update); } \
  1439.   NS_IMETHOD ShowUpdateHistory(nsIDOMWindow *parent) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowUpdateHistory(parent); } 
  1440.  
  1441. #if 0
  1442. /* Use the code below as a template for the implementation class for this interface. */
  1443.  
  1444. /* Header file */
  1445. class nsUpdatePrompt : public nsIUpdatePrompt
  1446. {
  1447. public:
  1448.   NS_DECL_ISUPPORTS
  1449.   NS_DECL_NSIUPDATEPROMPT
  1450.  
  1451.   nsUpdatePrompt();
  1452.  
  1453. private:
  1454.   ~nsUpdatePrompt();
  1455.  
  1456. protected:
  1457.   /* additional members */
  1458. };
  1459.  
  1460. /* Implementation file */
  1461. NS_IMPL_ISUPPORTS1(nsUpdatePrompt, nsIUpdatePrompt)
  1462.  
  1463. nsUpdatePrompt::nsUpdatePrompt()
  1464. {
  1465.   /* member initializers and constructor code */
  1466. }
  1467.  
  1468. nsUpdatePrompt::~nsUpdatePrompt()
  1469. {
  1470.   /* destructor code */
  1471. }
  1472.  
  1473. /* void checkForUpdates (); */
  1474. NS_IMETHODIMP nsUpdatePrompt::CheckForUpdates()
  1475. {
  1476.     return NS_ERROR_NOT_IMPLEMENTED;
  1477. }
  1478.  
  1479. /* void showUpdateAvailable (in nsIUpdate update); */
  1480. NS_IMETHODIMP nsUpdatePrompt::ShowUpdateAvailable(nsIUpdate *update)
  1481. {
  1482.     return NS_ERROR_NOT_IMPLEMENTED;
  1483. }
  1484.  
  1485. /* void showUpdateDownloaded (in nsIUpdate update); */
  1486. NS_IMETHODIMP nsUpdatePrompt::ShowUpdateDownloaded(nsIUpdate *update)
  1487. {
  1488.     return NS_ERROR_NOT_IMPLEMENTED;
  1489. }
  1490.  
  1491. /* void showUpdateInstalled (in nsIUpdate update); */
  1492. NS_IMETHODIMP nsUpdatePrompt::ShowUpdateInstalled(nsIUpdate *update)
  1493. {
  1494.     return NS_ERROR_NOT_IMPLEMENTED;
  1495. }
  1496.  
  1497. /* void showUpdateError (in nsIUpdate update); */
  1498. NS_IMETHODIMP nsUpdatePrompt::ShowUpdateError(nsIUpdate *update)
  1499. {
  1500.     return NS_ERROR_NOT_IMPLEMENTED;
  1501. }
  1502.  
  1503. /* void showUpdateHistory (in nsIDOMWindow parent); */
  1504. NS_IMETHODIMP nsUpdatePrompt::ShowUpdateHistory(nsIDOMWindow *parent)
  1505. {
  1506.     return NS_ERROR_NOT_IMPLEMENTED;
  1507. }
  1508.  
  1509. /* End of implementation class template. */
  1510. #endif
  1511.  
  1512.  
  1513. /* starting interface:    nsIUpdateTimerManager */
  1514. #define NS_IUPDATETIMERMANAGER_IID_STR "0765c92c-6145-4253-9db4-594d8023087e"
  1515.  
  1516. #define NS_IUPDATETIMERMANAGER_IID \
  1517.   {0x0765c92c, 0x6145, 0x4253, \
  1518.     { 0x9d, 0xb4, 0x59, 0x4d, 0x80, 0x23, 0x08, 0x7e }}
  1519.  
  1520. /**
  1521.  * An interface describing a global application service that allows long 
  1522.  * duration (e.g. 1-7 or more days, weeks or months) timers to be registered
  1523.  * and then fired. 
  1524.  */
  1525. class NS_NO_VTABLE nsIUpdateTimerManager : public nsISupports {
  1526.  public: 
  1527.  
  1528.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPDATETIMERMANAGER_IID)
  1529.  
  1530.   /**
  1531.    * Register an interval with the timer manager. The timer manager 
  1532.    * periodically checks to see if the interval has expired and if it has
  1533.    * calls the specified callback. This is persistent across application
  1534.    * restarts and can handle intervals of long durations.
  1535.    * @param   id
  1536.    *          An id that identifies the interval, used for persistence
  1537.    * @param   callback
  1538.    *          A nsITimerCallback object that is notified when the interval
  1539.    *          expires
  1540.    * @param   interval
  1541.    *          The length of time, in milliseconds, of the interval
  1542.    */
  1543.   /* void registerTimer (in AString id, in nsITimerCallback callback, in unsigned long interval); */
  1544.   NS_IMETHOD RegisterTimer(const nsAString & id, nsITimerCallback *callback, PRUint32 interval) = 0;
  1545.  
  1546. };
  1547.  
  1548. /* Use this macro when declaring classes that implement this interface. */
  1549. #define NS_DECL_NSIUPDATETIMERMANAGER \
  1550.   NS_IMETHOD RegisterTimer(const nsAString & id, nsITimerCallback *callback, PRUint32 interval); 
  1551.  
  1552. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  1553. #define NS_FORWARD_NSIUPDATETIMERMANAGER(_to) \
  1554.   NS_IMETHOD RegisterTimer(const nsAString & id, nsITimerCallback *callback, PRUint32 interval) { return _to RegisterTimer(id, callback, interval); } 
  1555.  
  1556. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  1557. #define NS_FORWARD_SAFE_NSIUPDATETIMERMANAGER(_to) \
  1558.   NS_IMETHOD RegisterTimer(const nsAString & id, nsITimerCallback *callback, PRUint32 interval) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterTimer(id, callback, interval); } 
  1559.  
  1560. #if 0
  1561. /* Use the code below as a template for the implementation class for this interface. */
  1562.  
  1563. /* Header file */
  1564. class nsUpdateTimerManager : public nsIUpdateTimerManager
  1565. {
  1566. public:
  1567.   NS_DECL_ISUPPORTS
  1568.   NS_DECL_NSIUPDATETIMERMANAGER
  1569.  
  1570.   nsUpdateTimerManager();
  1571.  
  1572. private:
  1573.   ~nsUpdateTimerManager();
  1574.  
  1575. protected:
  1576.   /* additional members */
  1577. };
  1578.  
  1579. /* Implementation file */
  1580. NS_IMPL_ISUPPORTS1(nsUpdateTimerManager, nsIUpdateTimerManager)
  1581.  
  1582. nsUpdateTimerManager::nsUpdateTimerManager()
  1583. {
  1584.   /* member initializers and constructor code */
  1585. }
  1586.  
  1587. nsUpdateTimerManager::~nsUpdateTimerManager()
  1588. {
  1589.   /* destructor code */
  1590. }
  1591.  
  1592. /* void registerTimer (in AString id, in nsITimerCallback callback, in unsigned long interval); */
  1593. NS_IMETHODIMP nsUpdateTimerManager::RegisterTimer(const nsAString & id, nsITimerCallback *callback, PRUint32 interval)
  1594. {
  1595.     return NS_ERROR_NOT_IMPLEMENTED;
  1596. }
  1597.  
  1598. /* End of implementation class template. */
  1599. #endif
  1600.  
  1601.  
  1602. #endif /* __gen_nsIUpdateService_h__ */
  1603.